<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增银行卡</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h3 class="mb-4">新增银行卡</h3>
    <form th:action="@{/admin/card/save}" method="post">
        <div class="form-group">
            <label>卡号</label>
            <input type="text" class="form-control" name="cardId" th:value="${generatedCardId}" readonly>
        </div>

        <div class="form-group">
            <label>开户金额</label>
            <input type="number" step="0.01" class="form-control" name="openMoney" required>
        </div>

        <div class="form-group">
            <label>账户余额</label>
            <input type="number" step="0.01" class="form-control" name="balance" required>
        </div>

        <div class="form-group">
            <label>取款密码</label>
            <input type="password" class="form-control" name="pass" value="88888888" required>
        </div>

        <div class="form-group">
            <label>是否挂失</label>
            <select class="form-control" name="isReportLoss">
                <option value="0">否</option>
                <option value="1">是</option>
            </select>
        </div>

        <div class="form-group">
            <label>开户日期</label>
            <input type="date" class="form-control" name="openDate" required>
        </div>

        <div class="form-group">
            <label>币种</label>
            <select class="form-control" name="curId">
                <option value="RMB">人民币</option>
                <option value="USD">美元</option>
                <option value="EUR">欧元</option>
            </select>
        </div>

        <div class="form-group">
            <label>所属客户</label>
            <select class="form-control" name="customerId">
                <option th:each="user : ${userList}" th:value="${user.customerId}" th:text="${user.name}"></option>
            </select>
        </div>
        <div class="form-group">
            <label>存款类型</label>
            <select class="form-control" name="savingId">
                <option th:each="saving : ${savingList}" th:value="${saving.savingId}" th:text="${saving.savingName}"></option>
            </select>
        </div>

        <button type="submit" class="btn btn-primary">提交</button>
        <a th:href="@{/admin/card/list}" class="btn btn-secondary ml-2">返回</a >
    </form>
</div>
</body>
</html>